package cn.seifly.demo;

import java.util.Collection;

public class ObjectUtils {
    public static boolean isNotEmpty(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj instanceof String) {
            return ((String) obj).trim().length() > 0;
        }
        if (obj instanceof Object[]) {
            return ((Object[]) obj).length > 0;
        }
        if (obj instanceof Collection) {
            return !((Collection)obj).isEmpty();
        }
        return false;
    }
}
